﻿using SHZY.Common.Security;
using SHZY.Common.Models;
using SHZY.BaseData.Entitys.Common.Dto.PrintTemplate;
using Mapster;
using SHZY.BaseData.Entitys.Common.Entity;

namespace SHZY.BaseData.Entitys.Common.Mapper.PrintTemplate;

public class Mapper : IRegister
{
	public void Register(TypeAdapterConfig config)
	{
		config.ForType<ComBasePrintTemplateCrInput, ComBasePrintTemplateEntity>()
			.Map(dest => dest.FileInfo, src => src.fileInfo.ToJsonString())
		;
		config.ForType<ComBasePrintTemplateEntity, ComBasePrintTemplateInfoOutput>()
			.Map(dest => dest.fileInfo, src => src.FileInfo.ToObject<List<FileControlsModel>>())
		;
	}
}
